home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / HyperCard / Resource Library / Resource Library / card_4872.txt < prev    next >
Text File  |  1989-05-28  |  4KB  |  200 lines

  1. -- card: 4872 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 6603
  5. -- name: Paste
  6. ----- HyperTalk script -----
  7. on idle
  8.   global runHilite
  9.  
  10.   if runHilite and not (visible of msg) then
  11.     highlight A
  12.   end if
  13.   put not runHilite into runHilite
  14. end idle
  15.  
  16. on InitPaste
  17.   put "" into card field File
  18.   put "" into card field Topaste
  19.   put "" into card field Name
  20. end InitPaste
  21.  
  22. --- hidden fields on this card: File, HighlightAreas
  23. on HideFields
  24.   set visible of card field "File" to false
  25.   set visible of card field "HighlightAreas" to false
  26. end HideFields
  27.  
  28. on ShowFields
  29.   set visible of card field "File" to true
  30.   set visible of card field "HighlightAreas" to true
  31. end ShowFields
  32.  
  33.  
  34.  
  35. -- part 1 (field)
  36. -- low flags: 00
  37. -- high flags: 0007
  38. -- rect: left=88 top=109 right=194 bottom=288
  39. -- title width / last selected line: 0
  40. -- icon id / first selected line: 0 / 0
  41. -- text alignment: 0
  42. -- font id: 3
  43. -- text size: 12
  44. -- style flags: 0
  45. -- line height: 16
  46. -- part name: ToPaste
  47.  
  48.  
  49. -- part 2 (field)
  50. -- low flags: 00
  51. -- high flags: 0004
  52. -- rect: left=87 top=268 right=288 bottom=272
  53. -- title width / last selected line: 0
  54. -- icon id / first selected line: 0 / 0
  55. -- text alignment: 0
  56. -- font id: 3
  57. -- text size: 12
  58. -- style flags: 0
  59. -- line height: 16
  60. -- part name: Name
  61.  
  62.  
  63. -- part 3 (button)
  64. -- low flags: 00
  65. -- high flags: A003
  66. -- rect: left=5 top=266 right=288 bottom=74
  67. -- title width / last selected line: 0
  68. -- icon id / first selected line: 0 / 0
  69. -- text alignment: 1
  70. -- font id: 0
  71. -- text size: 12
  72. -- style flags: 0
  73. -- line height: 16
  74. -- part name: Open…
  75. ----- HyperTalk script -----
  76. on mouseUp
  77.   if the optionKey is down then
  78.     put StandardFile("get") into theTarget
  79.   else
  80.     put StandardFile("get", "STAK", "XCMD", "APPL") into theTarget
  81.   end if
  82.   if theTarget is empty then
  83.     beep 1
  84.     answer "Request canceled." with "OK"
  85.   else
  86.     put theTarget into card field File
  87.     put StripPath(theTarget) into card field Name
  88.   end if
  89. end mouseUp
  90.  
  91.  
  92.  
  93. -- part 4 (button)
  94. -- low flags: 00
  95. -- high flags: A003
  96. -- rect: left=141 top=204 right=256 bottom=221
  97. -- title width / last selected line: 0
  98. -- icon id / first selected line: 6724 / 6724
  99. -- text alignment: 1
  100. -- font id: 0
  101. -- text size: 12
  102. -- style flags: 0
  103. -- line height: 16
  104. -- part name: Paste
  105. ----- HyperTalk script -----
  106. on mouseUp
  107.   global External_Error, StackName
  108.   if card field "File" = "" then
  109.     answer "You must open a file first!" with "Oops"
  110.     exit mouseUp
  111.   end if
  112.   put number of lines in card field "ToPaste" into len
  113.   if len < 1 then
  114.     answer "Nothing to Paste!" with "Oops"
  115.     exit mouseUp
  116.   end if
  117.   repeat with ix = 1 to len
  118.     put line ix of card field "ToPaste" into tmp
  119.     if tmp = "" then next repeat
  120.     put word 1 of tmp into restype
  121.     if length of restype <> 4 then
  122.       put char 1 to (4 - length of restype) of "    " after restype
  123.     end if
  124.     put tmp into resname
  125.     delete word 1 of resname
  126.     ResHandle "copy", StackName, card field "File", restype, resname
  127.     if External_Error <> "ok" then
  128.       answer "Paste failed" with "OK"
  129.       exit mouseUp
  130.     end if
  131.   end repeat
  132. end mouseUp
  133.  
  134.  
  135.  
  136. -- part 5 (field)
  137. -- low flags: 80
  138. -- high flags: 0000
  139. -- rect: left=4 top=24 right=44 bottom=471
  140. -- title width / last selected line: 0
  141. -- icon id / first selected line: 0 / 0
  142. -- text alignment: 0
  143. -- font id: 3
  144. -- text size: 12
  145. -- style flags: 0
  146. -- line height: 16
  147. -- part name: File
  148.  
  149.  
  150. -- part 6 (field)
  151. -- low flags: 80
  152. -- high flags: 0007
  153. -- rect: left=88 top=231 right=316 bottom=288
  154. -- title width / last selected line: 0
  155. -- icon id / first selected line: 0 / 0
  156. -- text alignment: 0
  157. -- font id: 3
  158. -- text size: 12
  159. -- style flags: 0
  160. -- line height: 16
  161. -- part name: HighlightAreas
  162.  
  163.  
  164. -- part 8 (button)
  165. -- low flags: 00
  166. -- high flags: 8003
  167. -- rect: left=4 top=138 right=160 bottom=74
  168. -- title width / last selected line: 0
  169. -- icon id / first selected line: 0 / 0
  170. -- text alignment: 1
  171. -- font id: 0
  172. -- text size: 12
  173. -- style flags: 0
  174. -- line height: 16
  175. -- part name: Clear
  176. ----- HyperTalk script -----
  177. on mouseUp
  178.   put "" into card field "ToPaste"
  179. end mouseUp
  180.  
  181.  
  182.  
  183. -- part contents for card part 6
  184. ----- text -----
  185. 11
  186. 475 26 504 59 opaq 1
  187. 475 60 504 93 opaq 2
  188. 424 163 505 185 roun 3
  189. 424 221 505 243 roun 4
  190. 424 192 505 214 roun 5
  191. 424 105 505 127 roun 6
  192. 471 300 502 331 opaq 7
  193. 424 134 505 156 roun 8
  194. 6 193 72 212 roun -1
  195. 142 132 219 181 roun -2
  196. 5 70 72 89 roun -3
  197.  
  198. -- part contents for background part 9
  199. ----- text -----
  200. Paste Card